import type { Ref } from "vue";
import type { tablePageTy } from "./type";
export default function () {
  /*分页*/
  // eslint-disable-next-line prefer-const
  let page: Ref<tablePageTy> = ref({
    currentPage: 1,
    pageSize: 10,
    total: 0,
  });
  const currentChange = (current: number) => {
    page.value.currentPage = current;
  };
  const sizeChange = (size: number) => {
    page.value.pageSize = size;
  };
  return {
    page,
    currentChange,
    sizeChange,
  };
}
